<template>
    <el-table
      :data="dataSourse"
      :max-height="660"
      :border="false"
      :highlight-current-row="true"
      row-key="uid"
      v-bind="attrs"
    >
        <template v-for="(item, index) in columns">
            <el-table-column :type="item.type" :prop="item.dataIndex" :align="item.align" :label="item.label" :keys="index">
                <template #default="scope">
                    <template v-if="item.render">{{ item.render(scope.row, index) }}</template>
                    <template v-if="item.slot && !item.render">
                      <slot :name="item.slot" :record="scope.row" :index="index"></slot>
                    </template>
                </template>
           </el-table-column>
        </template>
    </el-table>
</template>

<script lang="ts" setup name="BaseTable">
import { useAttrs } from 'vue'
let attrs = useAttrs()
let props = withDefaults(defineProps<{
    dataSourse: any[]
    columns: any[]
  }>(), {
    dataSourse: () => [],
    columns: () => []
  })
</script>

<style lang="less" scoped>

</style>
